/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ivanbiz.service;

import java.util.HashMap;
import java.util.Map;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.select.SelectorComposer;
import org.zkoss.zk.ui.select.annotation.Listen;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Window;

/**
 *
 * @author IW20149X
 */
public class LaporanJurnalService extends SelectorComposer<Component> {

    @Wire
    Datebox dari;
    @Wire
    Datebox sampai;

    @Listen("onClick=#lihat;")
    public void lihat() {
        if (dari.getValue() == null) {
            Messagebox.show("Dari Tanggal belum dipilih");
        } else if (sampai.getValue() == null) {
            Messagebox.show("Sampai Tanggal belum dipilih");
        } else {
            Map map = new HashMap();
            map.put("dari", dari.getValue());
            map.put("sampai", sampai.getValue());
            Window win = (Window) Executions.createComponents("/laporanJurnalView.zul", null, map);
            win.doModal();
        }
    }
}
